<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
     table{
        width: 500px;
        height: 100px;
        text-align: center;
        margin: 0 auto;
        border-collapse: collapse;
     }
    table,
    th,
    td{
        border: 1px soild #000;
    }
    </style>
</head>
<body>
     <table>
        <caption><h1>2012年12月份消费支出</h1></caption>
        <tr>
            <th>银行卡总额</th>
            <th>电费</th>
            <th>水费</th>
            <th>网费<th>
            <th>银行卡余额</th>
        </tr>
        <script>
            let rebtal = +prompt('请输入总额')
            console.log(typeof rebtal);
            let electric = +prompt('请输入电费')
            let water = +prompt('请输入水费')
            let initel = +prompt('请输入网费')
            let total = rebtal-water-electric-initel
            document.while (`
                 <tr>
                    <td>${rebtal}元</td>
                    <td>${electric}元</td>
                    <td>${water}元</td>
                    <td>${initel}元</td>
                    <td>${total}元</td>
                </tr>
            `) 
        </script>
    </table>  
</body>
</html>